﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Kortex.Common;

namespace Kortex.LedBulb
{
    public partial class KpLedPanel : UserControl
    {
        public KpLedPanel()
        {
            InitializeComponent();

            Init_toolTip();
        }

        private void Init_toolTip()
        {

            OpStateTip.SetToolTip(Opstate, "Operation State");
            ActiveInput_Tip.SetToolTip(activeInput, "Active input");
            Gaam_ToolT_TIp.SetToolTip(Gaama_LED, "Gamma Present");
            HealthTip.SetToolTip(Health, "Spectral calib");
            InProgress_Tip.SetToolTip(inProgress, "Command Inprogress");
            System_helth_tip.SetToolTip(System_helth_LED, "System Helth");
            

            
        }

        public void StartBlink(int milisecond, WhichLed which)
        {
            switch(which)
            {

                case  WhichLed.op_state_led:
                    Opstate.Blink(milisecond);
                    break;
                case  WhichLed.activeInput_led:
                    activeInput.Blink(milisecond);
                    break;
                case  WhichLed.Calib_led:
                    Health.Blink(milisecond);
                    break;
                case  WhichLed.inProgress_led:
                inProgress.Blink(milisecond);
                break;
                case  WhichLed.gamma_led:
                    Gaama_LED.Blink(milisecond);
                break;
                case  WhichLed.system_lealth_led:
                System_helth_LED.Blink(milisecond);
                break;


            }
        }


        public void SetToolTipTitle(string tiptile, WhichLed which)
        {

            switch (which)
            {

                case WhichLed.op_state_led:
                    OpStateTip.ToolTipTitle = tiptile;
                    break;
                case WhichLed.activeInput_led:
                    ActiveInput_Tip.ToolTipTitle = tiptile;
                    
                    break;
                case WhichLed.Calib_led:
                    HealthTip.ToolTipTitle = tiptile;
                   
                    break;
                case WhichLed.inProgress_led:
                    InProgress_Tip.ToolTipTitle = tiptile;
                    break;
                case WhichLed.gamma_led:
                    Gaam_ToolT_TIp.ToolTipTitle = tiptile;
                    break;
                case WhichLed.system_lealth_led:
                    System_helth_tip.ToolTipTitle = tiptile;
                    break;

            }
        }


        public void SetColor(Color col, WhichLed which)
        {

            switch (which)
            {

                case WhichLed.op_state_led:
                    Opstate.Color = col;
                    break;
                case WhichLed.activeInput_led:
                    activeInput.Color = col;
                    break;
                case WhichLed.Calib_led:
                    Health.Color = col;
                    break;
                case WhichLed.inProgress_led:
                    inProgress.Color = col;
                    break;
                case WhichLed.gamma_led:
                    Gaama_LED.Color = col;
                    break;
                case WhichLed.system_lealth_led:
                    System_helth_LED.Color = col;
                    break;
            }
        }


        public void StopBlink(WhichLed which)
        {
            
            switch(which)
            {

                case WhichLed.op_state_led:
                    Opstate.Blink(0);
                    break;
                case WhichLed.activeInput_led:
                    activeInput.Blink(0);
                    break;
                case WhichLed.Calib_led:
                    Health.Blink(0);
                    break;
                case WhichLed.inProgress_led:
                inProgress.Blink(0);
                break;
                case WhichLed.gamma_led:
                Gaama_LED.Blink(0);
                break;
                case WhichLed.system_lealth_led:
                System_helth_LED.Blink(0);
                break;

            }
        }

        
    }
}
